program FairSquareBITest;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  math,
  BigInt in 'BigInt.pas',
  BInt in 'BInt.pas';

var
  f, g: TextFile;

var
  fs, st: BigInteger;
begin
  try
    fs := BigInteger.Create;
    st := BigInteger.Create;
    AssignFile(f, 'FirstFS.txt');
    Reset(f);
    AssignFile(g, 'ProcessedFS1.txt');
    Rewrite(g);
    try
      while not eof(F) do begin
        fs.readFromFile(f);
        st := fs.SqrtRough;
        fs.writeToFile(g);
        Write(g, ' ^ 2 = ');
        st.writeToFile(g);
        Writeln(g);
        Flush(g);
      end;
    finally
      CloseFile(f);
      CloseFile(g);
    end;
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do begin
      Writeln(E.ClassName, ': ', E.Message);
      readln;
    end;
  end;
end.
